﻿@model Visao.Models.PeriodoModel

@section featured {
<section class="featured">
    <div class="content-wrapper">
        <hgroup class="title">
            <h1>@ViewBag.Title.</h1>
            <h2>@ViewBag.Message</h2>
        </hgroup>
    </div>
</section>
}

<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#DataInicioString").datepicker({ showOn: 'both', dateFormat: 'dd/mm/yy' });
        $("#DataFimString").datepicker({ showOn: 'both', dateFormat: 'dd/mm/yy' });
    });
</script>

<h3 style="color: Red">@ViewBag.Result</h3><br />

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>

        <div class="editor-label">
            @Html.LabelFor(model => model.DataInicioString)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DataInicioString)
            @Html.ValidationMessageFor(model => model.DataInicioString)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DataFimString)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DataFimString)
            @Html.ValidationMessageFor(model => model.DataFimString)
        </div>
        
        <p>
            <input type="submit" value="Consultar" />
        </p>
    </fieldset>
}

@if (Model.Quartos != null)
{
    <table>
        <tr>
            <th style="width:70px;">Número</th>
            <th style="width:120px;">Estado</th>
            <th>Categoria</th>
        </tr>  

    @foreach (var item in Model.Quartos)
    {
            <tr>
            <td>@Html.DisplayFor(modelItem => item.Numero)</td>
            <td>@Html.DisplayFor(modelItem => item.Estado)</td>
            <td>@Html.DisplayFor(modelItem => item.CategoriaDeQuarto.Nome)</td>
        </tr>    
    }
    </table>
}